package com.czxy.service.impl;

import com.czxy.dao.ProductDao;
import com.czxy.dao.impl.ProductDaoImpl;
import com.czxy.service.ProductService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component("productServiceImpl")
public class ProductServiceImpl implements ProductService {
    // 按照名称注入
    @Resource(name="productDaoImpl")
    //按照类型注入
//    @Resource
    private ProductDao productDao ;// = new ProductDaoImpl();

    @Override
    public void findAll() {
        System.out.println("productService...");
        productDao.findAll();
    }
}
